<template>
	<view class="About-us">
		<view class="About-usBox">
			<u-parse :html="content"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: "",
			}
		},
		onLoad(options) {
      // #ifdef APP-PLUS
      var args = plus.runtime.arguments;
      if(args){
        app.$vm.setShareDetail(args);
      }
      // #endif
			if(options.index){
				this.index = options.index;
				if(this.index==1){
					uni.setNavigationBarTitle({
						title:"证照公示"
					})
				}else if(this.index==2){
					uni.setNavigationBarTitle({
						title:"用户服务协议"
					})
				}else if(this.index==3){
					uni.setNavigationBarTitle({
						title:"隐私条款"
					})
				}else if(this.index==4){
					uni.setNavigationBarTitle({
						title:"知识产权声明"
					})
				}else if(this.index==5){
					uni.setNavigationBarTitle({
						title:"商户服务协议"
					})
				}else if(this.index==6){
					uni.setNavigationBarTitle({
						title:"其他证件说明"
					})
				}else if(this.index==7){
					uni.setNavigationBarTitle({
						title:"套餐结算说明"
					})
				}else if(this.index==8){
					uni.setNavigationBarTitle({
						title:"冻结金额说明"
					})
				}else if(this.index==9){
					uni.setNavigationBarTitle({
						title:"测评订单金额说明"
					})
				}else if(this.index==10){
					uni.setNavigationBarTitle({
						title:"内容推广说明"
					})
				}
				this.getCommon();
			}
		},
		methods: {
			getCommon(){
				let obj = {};
				if(this.index==1){
					obj.name = "license_publicity";
				}else if(this.index==2){
					obj.name = "agreement";
				}else if(this.index==3){
					obj.name = "privacy_clause";
				}else if(this.index==4){
					obj.name = "intellectual_property_declaration";
				}else if(this.index==5){
					obj.name = "merchant_service_agreement";
				}else if(this.index==6){
					obj.name = "other_certificates_explain";
				}else if(this.index==7){
					obj.name = "package_settlement_explain";
				}else if(this.index==8){
					obj.name = "release_evaluation_explain";
				}else if(this.index==9){
					obj.name = "evaluation_settlement_explain";
				}else if(this.index==10){
					obj.name = "content_description";
				}
				this.$u.api.commonDetails(obj).then(res=>{
					console.log(res)
					if(this.index==1){
						this.content = res.data.details.license_publicity.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==2){
						this.content = res.data.details.agreement.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==3){
						this.content = res.data.details.privacy_clause.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==4){
						this.content = res.data.details.intellectual_property_declaration.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==5){
						this.content = res.data.details.merchant_service_agreement.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==6){
						this.content = res.data.details.other_certificates_explain.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==7){
						this.content = res.data.details.package_settlement_explain.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==8){
						this.content = res.data.details.release_evaluation_explain.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==9){
						this.content = res.data.details.evaluation_settlement_explain.replace(/<img /g,"<img style='width:100%' ");
					}else if(this.index==10){
						this.content = res.data.details.content_description.replace(/<img /g,"<img style='width:100%' ");
					}
				})
			}
		}
	}
</script>

<style scoped lang="less">
.status_bar{
	height: var(--status-bar-height);
	width: 100%;
}
.About-us{
	min-height: 100vh;
	// overflow: auto;
	// padding-top: 88upx;
	// .About-usBox{
	// 	padding: 16upx 24upx;
	// }
}
</style>
